package com.gsafety.libraryktx.net.api.request

import android.R.attr
import com.gsafety.library.Utils.MD5
import com.gsafety.libraryktx.manager.UserManager
import okhttp3.MediaType
import okhttp3.MultipartBody
import okhttp3.RequestBody
import java.util.*


/**请求管理
 * @author : lj
 * @date : 2020/7/29 14:05
 */
object  RequestParamsManager {

    /**
     * 登录
     */
    fun login(userName: String, pwd: String): TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("username", userName)
        param.put("password", MD5.md5(pwd))
        return  param
    }

    /**
     * 检查用户登录状态和获取权限
     */
    fun logincheck(sessionId: String): TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("sessionId", sessionId)
        return  param
    }

    /**
     * 预警列表
     *
     */
    fun warnList(size: Int, current: Int, adtevtStatus: String, key: String):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("size", size)
        param.put("current", current)
        param.put("adtevtStatus", adtevtStatus)
        param.put("keyword", key)
        param.put("userId", UserManager.getInstance().getUser()?.userId + "")
        param.put("org", UserManager.getInstance().getUser()?.orgType + "")
        return  param
    }

    /**
     * 关注的预警列表
     *
     */
    fun myWarnList(size: Int, current: Int, key: String):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("size", size)
        param.put("current", current)
        param.put("attType", "1000201")
        param.put("attName", key)
        param.put("userId", UserManager.getInstance().getUser()?.userId + "")
        param.put("org", UserManager.getInstance().getUser()?.orgType + "")
        return  param
    }


    /**
     * 首页
     *
     */
    fun home(org: String, userId: String):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("org", org)
        param.put("userId", userId)
        return  param
    }

    /**
     * 统计分析
     * 获取当前监测预警数量统计
     *
     */
    fun currWarningStatis(org: String):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("org", org)
        return  param
    }

    /**
     * 统计分析
     * 获取近半年监测预警数量统计
     *
     */
    fun halfWarningStatis(org: String):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("org", org)
        return  param
    }
    /**
     * 统计分析
     * 本月监测预警处置时长统计
     *
     */
    fun specialWarningStatis(org: String):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("org", org)
        return  param
    }


    /**
     * 预警关注
     *
     */
    fun setAttention(pid: Int):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("attType", "1000201")
        param.put("attObject", pid)
        param.put("attId", UserManager.getInstance().getUser()!!.userId + "")
        return  param
    }

    /**
     * 预警处置接口
     *
     */
    fun addDisposalProc(
        pid: Int,
        dispType: String,
        contFlag: String,
        dispStatus: String,
        dispNote: String,
        procUnit: String,
        procerInfo: String,
        dispRstNote: String,
        dispTime: String,
        attachment:Object
    ):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("relAdtevtId", pid)
        param.put("dispType", dispType)
        param.put("contFlag", contFlag)
        param.put("dispStatus", dispStatus)
        param.put("dispNote", dispNote)
        param.put("procUnit", procUnit)
        param.put("procerInfo", procerInfo)
        param.put("dispRstNote", dispRstNote)
        param.put("dispTime", dispTime)
        param.put("attachment", attachment)
        return  param
    }

    /**
     * 预警关注
     *
     */
    fun currWarningDetail(pid: Int):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("pid", pid)
        param.put("userId", UserManager.getInstance().getUser()?.userId + "")
        return  param
    }

    /**
     *近半年监测预警趋势统计
     *
     */
    fun halfTrend(org: String):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("org", org)
        return  param
    }

    /**
     *当前各专项检测预警趋势统计
     *
     */
    fun specialTrend(org:String):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("org", org)
        return  param
    }

    /**
     *统计专项监测预警趋势分析
     *
     */
    fun specialStatis(org:String):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("org", org)
        return  param
    }

    /**
     *获取风险报告列表
     *
     */
    fun riskReport(reportName:String,reportType:String,specialsys:String,current:Int):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("reportName", reportName)
        param.put("reportType", reportType)
        param.put("specialsys", specialsys)
        param.put("current", current)
        return  param
    }

    /**
     *报告详情
     *
     */
    fun reportDetail(id:String):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("id", id)
        return  param
    }

    /**
     *修改密码
     *
     */
    fun updatePassword(userId:String,oldPass:String,newPass:String):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("userId", userId)
        param.put("oldPass", MD5.md5(oldPass))
        param.put("newPass", MD5.md5(newPass))
        return  param
    }
    /**
     *修改用户信息
     *
     */
    fun updateUserInfo(userId:String,phone:String,email:String):TreeMap<String, Any> {
        var param = TreeMap<String, Any>()
        param.put("userId", userId)
        param.put("phone", phone)
        param.put("email", email)
        return  param
    }
}